package com.mofofa.maozy.utils.analytics.bean

import android.content.pm.PackageManager
import android.os.Build
import com.mofofa.maozy.ProjectApplication
import com.mofofa.maozy.ProjectConfig
import com.mofofa.maozy.utils.analytics.util.AnalyticsUtil
import com.mofofa.maozy.utils.analytics.util.FirebaseUtil
import java.util.*

class ParamFirebaseS2S(
    /** 产品名 */
    var name: String = ProjectConfig.MAOZY_Pck,
    /** 版本号 */
    var OSAndVersion: String = "Android ${Build.VERSION.RELEASE}",
    /** 语言 */
    var locale: String = Locale.getDefault().toString(),
    /** 设备 */
    var device: String = Build.MODEL,
    /** app版本号 */
    var appVersion: String = ProjectConfig.MAOZY_Version.toString(),
    /** sdk版本号 */
    var sdkVersion: String = ProjectConfig.MAOZY_Version.toString(),
    /** build */
    var build: String = "Build/${Build.ID}",
    /** 广告是否限制跟踪 */
    var lat: String = AnalyticsUtil.getAdEnabled().toString(),
    /** firebasse id */
    var firebaseAppId: String = FirebaseUtil.getFirebaseAppId(),
    /** ga4 id */
    var ga4AppInstanceId: String = FirebaseUtil.getGa4InstanceId()
) : ParamBase() {
    init {
        //组装版本号
        val vVersion =
            ProjectApplication.instance.packageManager.getPackageInfo(
                ProjectApplication.instance.packageName,
                PackageManager.GET_META_DATA
            ).versionName
        this.appVersion = vVersion
        this.sdkVersion = vVersion
    }
}


